package cn.itcast.dao;

import cn.itcast.pojo.Address;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface BranchCourtsDao {
    /**
     * 查询所有分院
     *
     * @return
     */
//分页查询分院信息
//    Page<Address> selectByCondition(String queryString);
//不分页查询分院信息
    @Select("select * from t_address")
    List<Address> findAll();
    //新增分院
    @Insert( "insert into t_address values(#{code},#{name},#{address},#{detail},#{coordinate},#{enable})" )
    void submit(Address address);
    //修改分院地址
    @Update( "update t_address set id=#{id},code=#{code},name=#{name},address=#{address},detail=#{detail},coordinate=#{coordinate},enable=#{enable}," )
    void update(Address address, String checkitemIds);
    //删除分院地址
    @Delete( "delete from t_address where id=#{id}" )
    void delete(Integer id);
}
